home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / connect.man < prev    next >
Encoding:
Text File  |  1989-04-09  |  4.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. CONNECT               C Library Procedures                CONNECT
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      connect - initiate a connection on a socket
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  13.      ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
  14.  
  15.      ccoonnnneecctt((ss,, nnaammee,, nnaammeelleenn))
  16.      iinntt ss;;
  17.      ssttrruucctt ssoocckkaaddddrr **nnaammee;;
  18.      iinntt nnaammeelleenn;;
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.      The parameter _s is a socket.  If it is of type SOCK_DGRAM,
  22.      then this call specifies the peer with which the socket is
  23.      to be associated; this address is that to which datagrams
  24.      are to be sent, and the only address from which datagrams
  25.      are to be received.  If the socket is of type SOCK_STREAM,
  26.      then this call attempts to make a connection to another
  27.      socket.  The other socket is specified by _n_a_m_e, which is an
  28.      address in the communications space of the socket.  Each
  29.      communications space interprets the _n_a_m_e parameter in its
  30.      own way.  Generally, stream sockets may successfully _c_o_n_n_e_c_t
  31.      only once; datagram sockets may use _c_o_n_n_e_c_t multiple times
  32.      to change their association.  Datagram sockets may dissolve
  33.      the association by connecting to an invalid address, such as
  34.      a null address.
  35.  
  36. RREETTUURRNN VVAALLUUEE
  37.      If the connection or binding succeeds, then 0 is returned.
  38.      Otherwise a -1 is returned, and a more specific error code
  39.      is stored in _e_r_r_n_o.
  40.  
  41. EERRRROORRSS
  42.      The call fails if:
  43.  
  44.      [EBADF]             _S is not a valid descriptor.
  45.  
  46.      [ENOTSOCK]          _S is a descriptor for a file, not a
  47.                          socket.
  48.  
  49.      [EADDRNOTAVAIL]     The specified address is not available
  50.                          on this machine.
  51.  
  52.      [EAFNOSUPPORT]      Addresses in the specified address fam-
  53.                          ily cannot be used with this socket.
  54.  
  55.      [EISCONN]           The socket is already connected.
  56.  
  57.      [ETIMEDOUT]         Connection establishment timed out
  58.                          without establishing a connection.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CONNECT               C Library Procedures                CONNECT
  71.  
  72.  
  73.  
  74.      [ECONNREFUSED]      The attempt to connect was forcefully
  75.                          rejected.
  76.  
  77.      [ENETUNREACH]       The network isn't reachable from this
  78.                          host.
  79.  
  80.      [EADDRINUSE]        The address is already in use.
  81.  
  82.      [EFAULT]            The _n_a_m_e parameter specifies an area
  83.                          outside the process address space.
  84.  
  85.      [EINPROGRESS]       The socket is non-blocking and the con-
  86.                          nection cannot be completed immediately.
  87.                          It is possible to _s_e_l_e_c_t(2) for comple-
  88.                          tion by selecting the socket for writ-
  89.                          ing.
  90.  
  91.      [EALREADY]          The socket is non-blocking and a previ-
  92.                          ous connection attempt has not yet been
  93.                          completed.
  94.  
  95.      The following errors are specific to connecting names in the
  96.      UNIX domain.  These errors may not apply in future versions
  97.      of the UNIX IPC domain.
  98.  
  99.      [ENOTDIR]      A component of the path prefix is not a
  100.                     directory.
  101.  
  102.      [EINVAL]       The pathname contains a character with the
  103.                     high-order bit set.
  104.  
  105.      [ENAMETOOLONG] A component of a pathname exceeded 255 char-
  106.                     acters, or an entire path name exceeded 1023
  107.                     characters.
  108.  
  109.      [ENOENT]       The named socket does not exist.
  110.  
  111.      [EACCES]       Search permission is denied for a component
  112.                     of the path prefix.
  113.  
  114.      [EACCES]       Write access to the named socket is denied.
  115.  
  116.      [ELOOP]        Too many symbolic links were encountered in
  117.                     translating the pathname.
  118.  
  119. SSEEEE AALLSSOO
  120.      accept(2), select(2), socket(2), getsockname(2)
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.